package c_extends;

/**
 * @author Cheng-02
 * @version V1.0
 * @Package c_extends
 * @date 2024/3/26 19:08
 */
public class Test01 {
    public static void main(String[] args) {
        Fu fu = new Fu();
        fu.methodFu();
        fu.method();
        //fu.methodZi();//不能直接调用子类方法
        Zi zi = new Zi();
        zi.methodZi();
        zi.methodFu();//继承父类方法，能调用父类非私有方法
        zi.method();
        Fu fu1=new Zi();
        fu1.method();//父类引用子类对象，调用子类方法
    }
}
